﻿@model Eqwww.Config.AppConfig

@{
    ViewData["Title"] = "系统参数配置";
    Layout = "~/Views/Shared/_ManageFormLayout.cshtml";
}


<form id="form1" class="mdui-m-t-3 mdui-m-b-3">
    <div asp-validation-summary="ModelOnly" class="mdui-textfield-error"></div>
    <div class="mdui-container">

        <div class="mdui-row">

            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="AppName" class="mdui-textfield-label"></label>
                    <input asp-for="AppName" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="AppName" class="mdui-textfield-error"></span>
                </div>
            </div>
            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="AppVersion" class="mdui-textfield-label"></label>
                    <input asp-for="AppVersion" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="AppVersion" class="mdui-textfield-error"></span>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="MetaKeywords" class="mdui-textfield-label"></label>
                    <input asp-for="MetaKeywords" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="MetaKeywords" class="mdui-textfield-error"></span>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="MetaDescription" class="mdui-textfield-label"></label>
                    <input asp-for="MetaDescription" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="MetaDescription" class="mdui-textfield-error"></span>
                </div>
            </div>


            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield">
                    <label asp-for="IsOpen" class="mdui-textfield-label"></label>
                    <select asp-for="IsOpen" class="mdui-textfield-input mdui-color-grey-100">
                        <option value="true">开放</option>
                        <option value="false">关闭</option>
                    </select>
                    <i class="mdui-icon material-icons" style="position:absolute;right:0;">arrow_drop_down</i>
                    <span asp-validation-for="IsOpen" class="mdui-textfield-error"></span>
                    <div class="mdui-textfield-helper">系统关闭时,只有关联超管策略的角色下的用户才允许访问系统.</div>
                </div>

            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="CloseReason" class="mdui-textfield-label"></label>
                    <input asp-for="CloseReason" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="CloseReason" class="mdui-textfield-error"></span>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield">
                    <label asp-for="DefaultThemeColor" class="mdui-textfield-label"></label>
                    <input type="hidden" asp-for="DefaultThemeColor" />
                    <div class="default-theme-color-options">
                        <div class="mdui-row">
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-indigo mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="indigo">indigo</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-teal mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="teal">teal</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-deep-purple mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="deep-purple">deep-purple</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-blue-grey mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="blue-grey">blue-grey</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-red mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="red">red</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-pink mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="pink">pink</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-brown mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="brown">brown</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-green mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="green">green</div>

                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield">
                    <label asp-for="DefaultAccentColor" class="mdui-textfield-label"></label>
                    <input type="hidden" asp-for="DefaultAccentColor" />
                    <div class="default-theme-accent-color-options">
                        <div class="mdui-row ">
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-indigo-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="indigo">indigo</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-teal-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="teal">teal</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-deep-purple-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="deep-purple">deep-purple</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-blue-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="blue">blue</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-red-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="red">red</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-pink-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="pink">pink</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-deep-orange-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="deep-orange">deep-orange</div>

                            </div>
                            <div class="mdui-col-xs-4">
                                <div class="mdui-color-green-accent mdui-text-center mdui-p-a-1" style="cursor:pointer;" data-val="green">green</div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-list">

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.DarkDrawer)
                            </div>
                            <div class="mdui-list-item-text">
                                取消选择则左侧菜单栏为浅色背景
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="DarkDrawer" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.WhiteAppbar)
                            </div>
                            <div class="mdui-list-item-text">
                                选中则主页面顶部Appbar为白色背景,否则自适应。
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="WhiteAppbar" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.RealNameFirst)
                            </div>
                            <div class="mdui-list-item-text">
                                在需要显示用户名的情境下优先显示姓名
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="RealNameFirst" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.CanUseCustomAvatar)
                            </div>
                            <div class="mdui-list-item-text">
                                在新建用户、修改用户时可以编辑自定义头像
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="CanUseCustomAvatar" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.CanEditSelfCustomAvatar)
                            </div>
                            <div class="mdui-list-item-text">
                                在用户编辑个人信息时可以修改自己的自定义头像
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="CanEditSelfCustomAvatar" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.LoginRemberMeUseToggle)
                            </div>
                            <div class="mdui-list-item-text">
                                登录页面记住登录选项用开关代替checkbox
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="LoginRemberMeUseToggle" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>

                    <div class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content">
                            <div class="mdui-list-item-title">
                                @Html.DisplayNameFor(modelItem => Model.UseADLogin)
                            </div>
                            <div class="mdui-list-item-text">
                                是否启用AD域登录功能
                            </div>
                        </div>
                        <label class="mdui-switch">
                            <input asp-for="UseADLogin" />
                            <i class="mdui-switch-icon"></i>
                        </label>
                    </div>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="SelfAvatarImageMaxSize" class="mdui-textfield-label"></label>
                    <input asp-for="SelfAvatarImageMaxSize" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="SelfAvatarImageMaxSize" class="mdui-textfield-error"></span>
                </div>
            </div>

           

            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="HubServerUrl" class="mdui-textfield-label"></label>
                    <input asp-for="HubServerUrl" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="HubServerUrl" class="mdui-textfield-error"></span>
                </div>
            </div>

            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="ADPath" class="mdui-textfield-label"></label>
                    <input asp-for="ADPath" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="ADPath" class="mdui-textfield-error"></span>
                </div>
            </div>

        </div>

    </div>
</form>


@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}

    <script>

        function btn_setgongshitothreeday() {
            $('#KbzbspGongShiMin').val('4320');
        }

        function btn_setgg1() {
            $('#LxspGongShiMin1').val('7200');
        }

        function btn_setgg2() {
            $('#LxspGongShiMin2').val('7200');
        }

        function btn_setgg3() {
            $('#LxspGongShiMin3').val('7200');
        }

        function removeClass(el, clas) {
            var reg = new RegExp("(^|[^-])\\b" + clas + "\\b([^-]|$)", "g"),
                trim = /^\s+|\s+$/g,
                classStr = el.className;

            classStr = classStr.replace(reg, "");
            el.className = classStr.replace(trim, ""); 
        }

        $(function () {

            $('.default-theme-color-options').find('div[class^="mdui-color-@Model.DefaultThemeColor"]').append('<i class="mdui-icon  material-icons">check</i>');

            $('.default-theme-color-options').find('div[class^="mdui-color-"]').bind('click', function () {
                var $this = $(this);
                $('.default-theme-color-options').find('div[class^="mdui-color-"]').each(function () {
                    $(this).find('i').remove();
                });
                $this.append('<i class="mdui-icon  material-icons">check</i>');
                $('#DefaultThemeColor').val($this.attr('data-val'));
            });

            $('.default-theme-accent-color-options').find('div[class^="mdui-color-@Model.DefaultAccentColor-accent"]').append('<i class="mdui-icon  material-icons">check</i>');

            $('.default-theme-accent-color-options').find('div[class^="mdui-color-"]').bind('click', function () {
                var $this = $(this);
                $('.default-theme-accent-color-options').find('div[class^="mdui-color-"]').each(function () {
                    $(this).find('i').remove();
                });
                $this.append('<i class="mdui-icon material-icons">check</i>');
                $('#DefaultAccentColor').val($this.attr('data-val'));
            });
        });

        function submitForm() {
            if (!$("#form1").valid()) {
                return false;
            }
            var postData = $('#form1').formSerialize();
            $.submitForm({
                url: "/SystemManage/ConfigManage/AppConfigSubmit",
                param: postData,
                success: function () {
                    //top.window.location.reload();
                    $.currentWindow().location.reload();
                }
            });

        };
    </script>
}

